package com.codeZ.BuilderPattern.example01;

import com.codeZ.BuilderPattern.example01.builder.Builder;
import com.codeZ.BuilderPattern.example01.product.Bike;

/**
 * 指挥建造者类
 *
 * @author codeZhang
 * @Date 2024/8/2 16:10
 */
public class Director {

    private final Builder mBuilder;

    public Director(Builder builder) {
        this.mBuilder = builder;
    }

    public Bike construct() {
        mBuilder.buildFrame();
        mBuilder.buildSeat();
        return mBuilder.createBike();
    }

}
